﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Labopdracht.aspx.cs" Inherits="Lab_Default" %>
<%@ Register Src="~/ZoekPatient.ascx" TagName="ZoekPatient" TagPrefix="uc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <uc:ZoekPatient ID="ZoekPatient1" runat="server"/>

    <asp:GridView ID="GridView1" runat="server" AllowSorting="True" 
        DataSourceID="TestsVoorPat">
    </asp:GridView>

    <asp:SqlDataSource ID="TestsVoorPat" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="SELECT lt.Naam FROM Labaanvraag AS la
                         INNER JOIN Testaanvraag AS ta
                           ON ta.labavid = la.LABAVID AND
                              la.patient = @Patid     AND
                              la.status  = 0
                         INNER JOIN Labtest AS lt
                           ON lt.LABID = ta.labid"
        UpdateCommand="UPDATE Labaanvraag SET status=1 WHERE patient = @Patid">
        <SelectParameters>
            <asp:ControlParameter ControlID="ZoekPatient1" Name="Patid" 
                PropertyName="patid" Type="Int32" />
        </SelectParameters>
        <UpdateParameters>
            <asp:ControlParameter ControlID="ZoekPatient1" Name="Patid"
                PropertyName="patid" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>

    <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Labtest afgenomen" />

</asp:Content>

